projects
/
project
/
bcm63xx
/
u-boot.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2570e12
)
gpio: xilinx: Find out bank before use in xilinx_gpio_get_function()
author
Michal Simek
<
[email protected]
>
Mon, 23 Jul 2018 10:08:49 +0000
(12:08 +0200)
committer
Michal Simek
<
[email protected]
>
Tue, 7 Aug 2018 09:03:42 +0000
(11:03 +0200)
Call xilinx_gpio_get_bank_pin() before use.
Reported-by: Stefan Herbrechtsmeier <
[email protected]
>
Signed-off-by: Michal Simek <
[email protected]
>
Reviewed-by: Stefan Herbrechtsmeier <
[email protected]
>
drivers/gpio/xilinx_gpio.c
patch
|
blob
|
history
diff --git
a/drivers/gpio/xilinx_gpio.c
b/drivers/gpio/xilinx_gpio.c
index 48b52c985a55d0d2201912c9ec67b8682aa6a405..8ce08d80f491eb26e82f4fdeab1fbea502043f01 100644
(file)
--- a/
drivers/gpio/xilinx_gpio.c
+++ b/
drivers/gpio/xilinx_gpio.c
@@
-435,6
+435,10
@@
static int xilinx_gpio_get_function(struct udevice *dev, unsigned offset)
int val, ret;
u32 bank, pin;
+ ret = xilinx_gpio_get_bank_pin(offset, &bank, &pin, dev);
+ if (ret)
+ return ret;
+
/* Check if all pins are inputs */
if (platdata->bank_input[bank])
return GPIOF_INPUT;
@@
-443,10
+447,6
@@
static int xilinx_gpio_get_function(struct udevice *dev, unsigned offset)
if (platdata->bank_output[bank])
return GPIOF_OUTPUT;
- ret = xilinx_gpio_get_bank_pin(offset, &bank, &pin, dev);
- if (ret)
- return ret;
-
/* FIXME test on dual */
val = readl(&platdata->regs->gpiodir + bank * 2);
val = !(val & (1 << pin));